A computer system is comprised of numerous different components, each of which has a particular function in the operation of the computer system. For example, FIG. 1 depicts an exemplary embodiment of personal computer (xe2x80x9cPCxe2x80x9d) 1 which may be a computing device or other microprocessor-based device including processor 10, system memory 15, hard drive 20, disk drive 25, I/O devices 30, a display device 35, keyboard 40, mouse 45 and a connection to communication network 50 (e.g., the Internet). Each of these devices in PC 1 has one or more functions which allow PC 1 to operate in the manner intended by the user. For example, hard drive 20 stores data and files that the user may wish to access while operating PC 1, disk drive 25 may allow the user to load additional data into PC 1, I/O devices 30 may include a video card which allows output from PC 1 to be displayed on CRT display device 35.
System memory 15 may be, for example, Random Access Memory (xe2x80x9cRAMxe2x80x9d) which is a type of memory for storage of data on a temporary basis. In contrast to the memory in hard drive 20, system memory 15 is short term memory which is essentially erased each time PC 1 is powered off. System memory 15 holds temporary instructions and data needed to complete certain tasks. This temporary holding of data allows processor 10 to access instructions and data stored in system memory 15 very quickly. If processor 10 were required to access hard drive 20 or disk drive 25 each time it needed an instruction or data, it would significantly slow down the operation of PC 1. All the software currently running on PC 1 require some portion of system memory 15 for proper operation. For example, the operating system, currently running application programs and networking software may all require some portion of the memory space in system memory 15. Using the example of an application program, when the user of PC 1 enters a command in keyboard 40 or mouse 45 to open a word processing program, this command is carried out by processor 10. Part of executing this command is for data and instructions stored in hard drive 20 for the word processing program to be loaded into system memory 15 which can provide data and instructions to processor 10 more quickly than hard drive 20 as the user continues to enter commands for the word processing program to execute.
When system memory 15 is RAM, the memory is randomly allocated to the applications in small chunks as needed. The chunks allocated to individual software programs do not have to be located continuously within system memory 15. Processor 10 assigns each chunk a particular address and, in that way, processor 10 may randomly choose such addresses from a pool of available addresses. Since processor 10 continually assigns random addresses, the data for each individual program becomes highly fragmented throughout the memory space in system memory 15. This fragmentation requires processor 10 to access multiple memory areas of system memory 15 for an individual application. This multiple accessing of system memory 15 slows down program operation and leads to inefficiencies in the operation of PC 1.
Additionally, when processor 10 assigns addresses to the memory chunks of system memory 15, these chunks are of a defined size, for example, 8 bytes. Every time a particular address is accessed and used to store data, the entire chunk is allocated without regard to the actual size of the data. For example, if processor 10 is loading data having a size of 4 bytes into a chunk of system memory 15 which is 8 bytes, the entire 8 bytes is not available even though only 4 of the 8 bytes are actually being used. As more data is stored in the temporary memory of system memory 15, there may be a large amount of memory allocated to data that is not actually being used, but yet it cannot be allocated for other data because processor 10 detects that the address for the space is in use. Similarly, if processor 10 is loading data that is larger than the pre-assigned defined size of the chunks, chunks must be coalesced into a chunk large enough to handle the information.
A method for managing a memory of a computer system to store data of a particular size by defining chunks of the memory, wherein each chunk is a continuous memory space of a predetermined size. Defining chunk pools for managing the chunks, wherein each chunk pool corresponds to chunks of a particular size and defining unit pools for managing units of the first size, wherein the chunk pool corresponding to the unit pool provides a chunk of the particular size to be separated into the units of the first size, and the data of the first size is stored in the units.